
<!DOCTYPE html>
<html lang="zh-Hans" class="loading">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>20个超级实用的css代码 - 默默默默燃</title>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="google" content="notranslate" />
    <meta name="keywords" content="TriDiamond Obsidian,"> 
    <meta name="description" content="一枚前端搬砖队队员的记录册,原文地址
大家非常的清楚CSS是我们Web制作中不可或缺的一部分。HTML提供了Web制作的结构，但他不能让我们实现美丽的页面制作，此时我们需要CSS的帮助。CSS虽然能帮我们完善Web制作的效果，,"> 
    <meta name="author" content="张白告丶"> 
    <link rel="alternative" href="atom.xml" title="默默默默燃" type="application/atom+xml"> 
    <link rel="icon" href="/img/favicon.png"> 
    <link href="https://fonts.loli.net/css?family=Roboto+Mono|Rubik&display=swap" rel="stylesheet">
    
<link rel="stylesheet" href="//at.alicdn.com/t/font_1429596_nzgqgvnmkjb.css">

    
<link rel="stylesheet" href="//cdn.bootcss.com/animate.css/3.7.2/animate.min.css">

    
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/css/share.min.css">

    
<link rel="stylesheet" href="//cdn.bootcss.com/codemirror/5.48.4/codemirror.min.css">

    
<link rel="stylesheet" href="//cdn.bootcss.com/codemirror/5.48.4/theme/dracula.css">

    
<link rel="stylesheet" href="/css/obsidian.css">

    
<link rel="stylesheet" href="/css/ball-atom.min.css">

<meta name="generator" content="Hexo 4.2.0"></head>


<body class="loading">
    <div class="loader">
        <div class="la-ball-atom la-2x">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
    <span id="config-title" style="display:none">默默默默燃</span>
    <div id="loader"></div>
    <div id="single">
    <div class="scrollbar gradient-bg-rev"></div>
<div id="top" style="display: block;">
    <div class="bar" style="width: 0;"></div>
    <div class="navigation animated fadeIn fast delay-1s">
        <img id="home-icon" class="icon-home" src="/img/favicon.png" alt="" data-url="https://zhanghao-web.github.io">
        <div id="play-icon" title="Play/Pause" class="iconfont icon-play"></div>
        <h3 class="subtitle">20个超级实用的css代码</h3>
        <div class="social">
            <!--        <div class="like-icon">-->
            <!--            <a href="javascript:;" class="likeThis active"><span class="icon-like"></span><span class="count">76</span></a>-->
            <!--        </div>-->
            <div>
                <div class="share">
                    
                        <a href="javascript:;" class="iconfont icon-share1"></a>
                        <div class="share-component-cc" data-disabled="facebook,douban,linkedin,diandian,tencent,google"></div>
                    
                </div>
            </div>
        </div>
    </div>
</div>

    <div class="section">
        <div class=article-header-wrapper>
    <div class="article-header">
        <div class="article-cover animated fadeIn" style="
            animation-delay: 600ms;
            animation-duration: 1.2s;
            background-image: 
                radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
                url(/img/cover.jpg) ">
        </div>
        <div class="else">
            <p class="animated fadeInDown">
                
                <a href="/categories/Css3"><b>「
                    </b>CSS3<b> 」</b></a>
                
                March 18, 2018
            </p>
            <h3 class="post-title animated fadeInDown"><a href="/2018/03/18/CSS3/20%E4%B8%AA%E8%B6%85%E7%BA%A7%E5%AE%9E%E7%94%A8%E7%9A%84css%E4%BB%A3%E7%A0%81/" title="20个超级实用的css代码" class="">20个超级实用的css代码</a>
            </h3>
            
            <p class="post-count animated fadeInDown">
                
                <span>
                    <b class="iconfont icon-text2"></b> <i>Words count</i>
                    42k
                </span>
                
                
                <span>
                    <b class="iconfont icon-timer__s"></b> <i>Reading time</i>
                    38 mins.
                </span>
                
                
                
                <span id="busuanzi_container_page_pv">
                    <b class="iconfont icon-read"></b> <i>Read count</i>
                    <span id="busuanzi_value_page_pv">0</span>
                </span>
                
            </p>
            
            
            <ul class="animated fadeInDown post-tags-list" itemprop="keywords"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Css3/" rel="tag">Css3</a></li></ul>
            
        </div>
    </div>
</div>

<div class="screen-gradient-after">
    <div class="screen-gradient-content">
        <div class="screen-gradient-content-inside">
            <div class="bold-underline-links screen-gradient-sponsor">
                <p>
                    <span class="animated fadeIn delay-1s"></span>
                </p>
            </div>
        </div>
    </div>
</div>

<div class="article">
    <div class='main'>
        <div class="content markdown animated fadeIn">
            <p><a href="https://www.w3cplus.com/css/20-incredibly-useful-CSS-snippets-for-developers" target="_blank" rel="noopener">原文地址</a></p>
<p>大家非常的清楚CSS是我们Web制作中不可或缺的一部分。HTML提供了Web制作的结构，但他不能让我们实现美丽的页面制作，此时我们需要CSS的帮助。CSS虽然能帮我们完善Web制作的效果，但其在不同的浏览器下是有不可预知的效果，为了让你的CSS能解决这些不一致下，今天给大家介绍25个CSS技巧代码，我相信这些对你肯家有很大的作用。</p>
<h2 id="使用text-indent来隐藏文本"><a href="#使用text-indent来隐藏文本" class="headerlink" title="使用text-indent来隐藏文本"></a>使用text-indent来隐藏文本</h2><p>这个常用在图片替换文本中，最常见的就是使用使用图片来替换Logo，这个是非常有用的，使用“text-indent”我们可以达到图片替换文本的效果，而且方便搜索引擎的优化，还能支持阅读器阅读网页内容：<br><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br></pre></td><td class="code"><pre><span class="line">			<span class="selector-tag">h1</span> &#123;</span><br><span class="line">				<span class="attribute">text-indent</span>:-<span class="number">9999px</span>;</span><br><span class="line">				<span class="attribute">margin</span>:<span class="number">0</span> auto;</span><br><span class="line">				<span class="attribute">width</span>:<span class="number">400px</span>;</span><br><span class="line">				<span class="attribute">height</span>:<span class="number">100px</span>;</span><br><span class="line">				<span class="attribute">background</span>:transparent <span class="built_in">url</span>(<span class="string">"images/logo.jpg"</span>) no-repeat scroll;</span><br><span class="line">			&#125;</span><br><span class="line">```	</span><br><span class="line">## 根据文件格式设置链接图标</span><br><span class="line">这个技巧主要是针对用户体验，让用户能很清楚点击的链接是有关于什么方面的内容，比如说，点击某个链接会到跳到站外。换句话说使用属性选择器器，给不同的链接设置不同的图标，让用户很轻松的明白相应的链接是有关于什么方面的内容：</span><br><span class="line">```<span class="selector-tag">css</span></span><br><span class="line">			<span class="selector-tag">a</span><span class="selector-attr">[href^=<span class="string">"http:"</span>]</span> &#123;</span><br><span class="line">					<span class="attribute">display</span>:inline-block;</span><br><span class="line">					<span class="attribute">padding-right</span>:<span class="number">14px</span>;</span><br><span class="line">					<span class="attribute">background</span>:transparent <span class="built_in">url</span>(/Images/ExternalLink.gif) center right no-repeat;</span><br><span class="line">			&#125;</span><br><span class="line">			<span class="selector-tag">a</span><span class="selector-attr">[href^=<span class="string">"mailto:"</span>]</span> &#123;</span><br><span class="line">					<span class="attribute">display</span>:inline-block;</span><br><span class="line">					<span class="attribute">padding-left</span>:<span class="number">20px</span>;</span><br><span class="line">					<span class="attribute">line-height</span>:<span class="number">18px</span>;</span><br><span class="line">					<span class="attribute">background</span>:transparent <span class="built_in">url</span>(/Images/MailTo.gif) center left no-repeat;</span><br><span class="line">			&#125;</span><br><span class="line">			<span class="selector-tag">a</span><span class="selector-attr">[href$=<span class="string">'.pdf'</span>]</span> &#123;</span><br><span class="line">					<span class="attribute">display</span>:inline-block;</span><br><span class="line">					<span class="attribute">padding-left</span>:<span class="number">20px</span>;</span><br><span class="line">					<span class="attribute">line-height</span>:<span class="number">18px</span>;</span><br><span class="line">					<span class="attribute">background</span>:transparent <span class="built_in">url</span>(/Images/PDFIcon.gif) center left no-repeat;</span><br><span class="line">			&#125;</span><br><span class="line">			<span class="selector-tag">a</span><span class="selector-attr">[href$=<span class="string">'.swf'</span>]</span>, <span class="selector-tag">a</span><span class="selector-attr">[href$=<span class="string">'.fla'</span>]</span>, <span class="selector-tag">a</span><span class="selector-attr">[href$=<span class="string">'.swd'</span>]</span> &#123;</span><br><span class="line">					<span class="attribute">display</span>:inline-block;</span><br><span class="line">					<span class="attribute">padding-left</span>:<span class="number">20px</span>;</span><br><span class="line">					<span class="attribute">line-height</span>:<span class="number">18px</span>;</span><br><span class="line">					<span class="attribute">background</span>:transparent <span class="built_in">url</span>(/Images/FlashIcon.gif) center left no-repeat;</span><br><span class="line">			&#125;</span><br><span class="line">			<span class="selector-tag">a</span><span class="selector-attr">[href$=<span class="string">'.xls'</span>]</span>, <span class="selector-tag">a</span><span class="selector-attr">[href$=<span class="string">'.csv'</span>]</span>, <span class="selector-tag">a</span><span class="selector-attr">[href$=<span class="string">'.xlt'</span>]</span>, <span class="selector-tag">a</span><span class="selector-attr">[href$=<span class="string">'.xlw'</span>]</span> &#123;</span><br><span class="line">					<span class="attribute">display</span>:inline-block;</span><br><span class="line">					<span class="attribute">padding-left</span>:<span class="number">20px</span>;</span><br><span class="line">					<span class="attribute">line-height</span>:<span class="number">18px</span>;</span><br><span class="line">					<span class="attribute">background</span>:transparent <span class="built_in">url</span>(/Images/ExcelIcon.gif) center left no-repeat;</span><br><span class="line">			&#125;</span><br><span class="line">			<span class="selector-tag">a</span><span class="selector-attr">[href$=<span class="string">'.ppt'</span>]</span>, <span class="selector-tag">a</span><span class="selector-attr">[href$=<span class="string">'.pps'</span>]</span> &#123;</span><br><span class="line">					<span class="attribute">display</span>:inline-block;</span><br><span class="line">					<span class="attribute">padding-left</span>:<span class="number">20px</span>;</span><br><span class="line">					<span class="attribute">line-height</span>:<span class="number">18px</span>;</span><br><span class="line">					<span class="attribute">background</span>:transparent <span class="built_in">url</span>(/Images/PowerPointIcon.gif) center left no-repeat;</span><br><span class="line">			&#125;</span><br><span class="line">			<span class="selector-tag">a</span><span class="selector-attr">[href$=<span class="string">'.doc'</span>]</span>, <span class="selector-tag">a</span><span class="selector-attr">[href$=<span class="string">'.rtf'</span>]</span>, <span class="selector-tag">a</span><span class="selector-attr">[href$=<span class="string">'.txt'</span>]</span>, <span class="selector-tag">a</span><span class="selector-attr">[href$=<span class="string">'.wps'</span>]</span> &#123;</span><br><span class="line">					<span class="attribute">display</span>:inline-block;</span><br><span class="line">					<span class="attribute">padding-left</span>:<span class="number">20px</span>;</span><br><span class="line">					<span class="attribute">line-height</span>:<span class="number">18px</span>;</span><br><span class="line">					<span class="attribute">background</span>:transparent <span class="built_in">url</span>(/Images/WordDocIcon.gif) center left no-repeat;</span><br><span class="line">			&#125;</span><br><span class="line">			<span class="selector-tag">a</span><span class="selector-attr">[href$=<span class="string">'.zip'</span>]</span>, <span class="selector-tag">a</span><span class="selector-attr">[href$=<span class="string">'.gzip'</span>]</span>, <span class="selector-tag">a</span><span class="selector-attr">[href$=<span class="string">'.rar'</span>]</span> &#123;</span><br><span class="line">					<span class="attribute">display</span>:inline-block;</span><br><span class="line">					<span class="attribute">padding-left</span>:<span class="number">20px</span>;</span><br><span class="line">					<span class="attribute">line-height</span>:<span class="number">18px</span>;</span><br><span class="line">					<span class="attribute">background</span>:transparent <span class="built_in">url</span>(/Images/ZIPIcon.gif) center left no-repeat;</span><br><span class="line">			&#125;</span><br></pre></td></tr></table></figure></p>
<h2 id="在IE浏览器中删除textarea的滚动条"><a href="#在IE浏览器中删除textarea的滚动条" class="headerlink" title="在IE浏览器中删除textarea的滚动条"></a>在IE浏览器中删除textarea的滚动条</h2><p>IE浏览器中textarea默认就有滚动条出现，为了达到所有浏览器默认下一致的效果，其实我们可以使用代码让他达到一致的效果：</p>
<figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">textarea</span>&#123;</span><br><span class="line">    <span class="attribute">overflow</span>:auto;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h2 id="段落首字下沉"><a href="#段落首字下沉" class="headerlink" title="段落首字下沉"></a>段落首字下沉</h2><p>有杂志排版中我们常看到第一个段落的首字下沉的效果，其实这种效果实现是相当的容易：<br><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">p</span><span class="selector-pseudo">:first-letter</span>&#123;</span><br><span class="line">    <span class="attribute">display</span>:block;</span><br><span class="line">    <span class="attribute">margin</span>:<span class="number">5px</span> <span class="number">0</span> <span class="number">0</span> <span class="number">5px</span>;</span><br><span class="line">    <span class="attribute">float</span>:left;</span><br><span class="line">    <span class="attribute">color</span>:<span class="number">#FF3366</span>;</span><br><span class="line">    <span class="attribute">font-size</span>:<span class="number">60px</span>;</span><br><span class="line">    <span class="attribute">font-family</span>:Georgia;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<h2 id="所有浏览器下的CSS透明度"><a href="#所有浏览器下的CSS透明度" class="headerlink" title="所有浏览器下的CSS透明度"></a>所有浏览器下的CSS透明度</h2><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-class">.transparent</span> &#123;</span><br><span class="line">    <span class="attribute">zoom</span>: <span class="number">1</span>;</span><br><span class="line">    <span class="attribute">filter</span>: <span class="built_in">alpha</span>(opacity=<span class="number">50</span>);</span><br><span class="line">    <span class="attribute">opacity</span>: <span class="number">0.5</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>但是使用opacity会影响其后代元素的透明度，我们可以考虑使用：<br><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br></pre></td><td class="code"><pre><span class="line">		<span class="selector-class">.transparent</span> &#123;</span><br><span class="line">			<span class="comment">/* Fallback for web browsers that doesn't support RGBa */</span></span><br><span class="line">			<span class="attribute">background</span>: <span class="built_in">rgb</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>);</span><br><span class="line">			<span class="comment">/* RGBa with 0.6 opacity */</span></span><br><span class="line">			<span class="attribute">background</span>: <span class="built_in">rgba</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0.6</span>);</span><br><span class="line">			<span class="comment">/* For IE 5.5 - 7*/</span></span><br><span class="line">			<span class="attribute">filter</span>:progid:DXImageTransform.Microsoft.<span class="built_in">gradient</span>(startColorstr=#<span class="number">99000000</span>, endColorstr=#<span class="number">99000000</span>);</span><br><span class="line">			<span class="comment">/* For IE 8*/</span></span><br><span class="line">			<span class="attribute">-ms-filter</span>: <span class="string">"progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)"</span>;</span><br><span class="line">		&#125;</span><br><span class="line">```	</span><br><span class="line"></span><br><span class="line">## <span class="selector-tag">Reset</span> <span class="selector-tag">Css</span></span><br><span class="line">```<span class="selector-tag">css</span></span><br><span class="line"><span class="selector-tag">body</span>,<span class="selector-tag">ul</span>,<span class="selector-tag">ol</span>,<span class="selector-tag">dl</span>,<span class="selector-tag">dd</span>,<span class="selector-tag">dir</span>,<span class="selector-tag">h1</span>,<span class="selector-tag">h2</span>,<span class="selector-tag">h3</span>,<span class="selector-tag">h4</span>,<span class="selector-tag">h5</span>,<span class="selector-tag">h6</span>,<span class="selector-tag">p</span>,<span class="selector-tag">pre</span>,<span class="selector-tag">blockquote</span>,<span class="selector-tag">hr</span>,<span class="selector-tag">figure</span>&#123;</span><br><span class="line">      <span class="attribute">margin</span>:<span class="number">0</span>;</span><br><span class="line">      <span class="attribute">padding</span>:<span class="number">0</span>;</span><br><span class="line">      <span class="attribute">font-size</span>: <span class="number">100%</span>;</span><br><span class="line">      <span class="attribute">vertical-align</span>:baseline;</span><br><span class="line">		&#125;</span><br><span class="line"></span><br><span class="line">		<span class="selector-tag">table</span> &#123;</span><br><span class="line">			<span class="attribute">border-collapse</span>:collapse;</span><br><span class="line">			<span class="attribute">border-spacing</span>:<span class="number">0</span>;</span><br><span class="line">		&#125;</span><br><span class="line"></span><br><span class="line">		<span class="selector-tag">article</span>, <span class="selector-tag">aside</span>, <span class="selector-tag">dialog</span>, <span class="selector-tag">figure</span>, <span class="selector-tag">footer</span>, <span class="selector-tag">header</span>, <span class="selector-tag">hgroup</span>, <span class="selector-tag">nav</span>, <span class="selector-tag">section</span> &#123; </span><br><span class="line">			<span class="attribute">display</span>:block;</span><br><span class="line">		&#125;</span><br><span class="line"></span><br><span class="line">		<span class="comment">/*</span></span><br><span class="line"><span class="comment">		 * Corrects inline-block display not defined in IE6/7/8/9 &amp; FF3</span></span><br><span class="line"><span class="comment">		 */</span></span><br><span class="line"></span><br><span class="line">		<span class="selector-tag">audio</span>,</span><br><span class="line">		<span class="selector-tag">canvas</span>,</span><br><span class="line">		<span class="selector-tag">video</span> &#123;</span><br><span class="line">			<span class="attribute">display</span>: inline-block;</span><br><span class="line">			*display: inline;</span><br><span class="line">			*<span class="selector-tag">zoom</span>: 1;</span><br><span class="line">		&#125;</span><br><span class="line"></span><br><span class="line">		<span class="comment">/*</span></span><br><span class="line"><span class="comment">		 * Prevents modern browsers from displaying 'audio' without controls</span></span><br><span class="line"><span class="comment">		 */</span></span><br><span class="line"></span><br><span class="line">		<span class="selector-tag">audio</span><span class="selector-pseudo">:not(</span><span class="selector-attr">[controls]</span>) &#123;</span><br><span class="line">			<span class="attribute">display</span>: none;</span><br><span class="line">		&#125;</span><br><span class="line"></span><br><span class="line">		<span class="comment">/*</span></span><br><span class="line"><span class="comment">		 * Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4</span></span><br><span class="line"><span class="comment">		 * Known issue: no IE6 support</span></span><br><span class="line"><span class="comment">		 */</span></span><br><span class="line"></span><br><span class="line">		<span class="selector-attr">[hidden]</span> &#123;</span><br><span class="line">			<span class="attribute">display</span>: none;</span><br><span class="line">		&#125;</span><br></pre></td></tr></table></figure></p>
<h2 id="图片预加载"><a href="#图片预加载" class="headerlink" title="图片预加载"></a>图片预加载</h2><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-id">#preloader</span> &#123;</span><br><span class="line">			<span class="comment">/* Images you want to preload*/</span></span><br><span class="line">			<span class="attribute">background-image</span>: <span class="built_in">url</span>(image1.jpg);</span><br><span class="line">			<span class="attribute">background-image</span>: <span class="built_in">url</span>(image2.jpg);</span><br><span class="line">			<span class="attribute">background-image</span>: <span class="built_in">url</span>(image3.jpg);</span><br><span class="line">			<span class="attribute">width</span>: <span class="number">0px</span>;</span><br><span class="line">			<span class="attribute">height</span>: <span class="number">0px</span>;</span><br><span class="line">			<span class="attribute">display</span>: inline;</span><br><span class="line">		&#125;</span><br></pre></td></tr></table></figure>
<h2 id="基本的CSS-Sprite按钮"><a href="#基本的CSS-Sprite按钮" class="headerlink" title="基本的CSS Sprite按钮"></a>基本的CSS Sprite按钮</h2><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">a</span> &#123;</span><br><span class="line">    <span class="attribute">display</span>: block;</span><br><span class="line">    <span class="attribute">background</span>: <span class="built_in">url</span>(sprite.png) no-repeat;</span><br><span class="line">    <span class="attribute">height</span>: <span class="number">30px</span>;</span><br><span class="line">    <span class="attribute">width</span>: <span class="number">250px</span>;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-tag">a</span><span class="selector-pseudo">:hover</span> &#123;</span><br><span class="line">    <span class="attribute">background-position</span>: <span class="number">0</span> -<span class="number">30px</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h2 id="Google-Font-API"><a href="#Google-Font-API" class="headerlink" title="Google Font API"></a>Google Font API</h2><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&lt;<span class="selector-tag">head</span>&gt;</span><br><span class="line">    Inconsolata:italic|Droid+Sans"</span><br><span class="line">&lt;/head&gt;</span><br><span class="line"></span><br><span class="line"><span class="selector-tag">body</span> &#123;</span><br><span class="line">    <span class="attribute">font-family</span>: <span class="string">'Tangerine'</span>, <span class="string">'Inconsolata'</span>, <span class="string">'Droid Sans'</span>, serif; <span class="attribute">font-size</span>: <span class="number">48px</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h2 id="浏览器的专用hack"><a href="#浏览器的专用hack" class="headerlink" title="浏览器的专用hack"></a>浏览器的专用hack</h2><p>浏览器的兼容问题向来都是很烦的事情，特别是在IE下的兼容问题。但有时我们为了达到一致的效果，不得不使用浏览器的兼容：<br><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br></pre></td><td class="code"><pre><span class="line">		<span class="comment">/* IE 6 */</span></span><br><span class="line">		* <span class="selector-tag">html</span> <span class="selector-class">.yourclass</span> &#123; &#125;</span><br><span class="line"></span><br><span class="line">		<span class="comment">/* IE 7 */</span></span><br><span class="line">		*+<span class="selector-tag">html</span> <span class="selector-class">.yourclass</span>&#123; &#125;</span><br><span class="line"></span><br><span class="line">		<span class="comment">/* IE 7 and modern browsers */</span></span><br><span class="line">		<span class="selector-tag">html</span>&gt;<span class="selector-tag">body</span> <span class="selector-class">.yourclass</span> &#123; &#125;</span><br><span class="line"></span><br><span class="line">		<span class="comment">/* Modern browsers (not IE 7) */</span></span><br><span class="line">		<span class="selector-tag">html</span>&gt;<span class="comment">/**/</span><span class="selector-tag">body</span> <span class="selector-class">.yourclass</span> &#123; &#125;</span><br><span class="line"></span><br><span class="line">		<span class="comment">/* Opera 9.27 and below */</span></span><br><span class="line">		<span class="selector-tag">html</span><span class="selector-pseudo">:first-child</span> <span class="selector-class">.yourclass</span> &#123; &#125;</span><br><span class="line"></span><br><span class="line">		<span class="comment">/* Safari */</span></span><br><span class="line">		<span class="selector-tag">html</span><span class="selector-attr">[xmlns*=<span class="string">""</span>]</span> <span class="selector-tag">body</span><span class="selector-pseudo">:last-child</span> <span class="selector-class">.yourclass</span> &#123; &#125;</span><br><span class="line"></span><br><span class="line">		<span class="comment">/* Safari 3+, Chrome 1+, Opera 9+, Fx 3.5+ */</span></span><br><span class="line">		<span class="selector-tag">body</span><span class="selector-pseudo">:nth-of-type(1)</span> <span class="selector-class">.yourclass</span> &#123; &#125;</span><br><span class="line"></span><br><span class="line">		<span class="comment">/* Safari 3+, Chrome 1+, Opera 9+, Fx 3.5+ */</span></span><br><span class="line">		<span class="selector-tag">body</span><span class="selector-pseudo">:first-of-type</span> <span class="selector-class">.yourclass</span> &#123;  &#125;</span><br><span class="line"></span><br><span class="line">		<span class="comment">/* Safari 3+, Chrome 1+ */</span></span><br><span class="line">		<span class="keyword">@media</span> screen <span class="keyword">and</span> (<span class="attribute">-webkit-min-device-pixel-ratio:</span><span class="number">0</span>) &#123;</span><br><span class="line">		 <span class="selector-class">.yourclass</span>  &#123;  &#125;</span><br><span class="line">		&#125;</span><br><span class="line"> ```       </span><br><span class="line"></span><br><span class="line">## 固定页脚</span><br><span class="line">固定页脚在屏幕的底部，在现代浏览器来说是一件非常容易的事情，但是在<span class="selector-tag">IE6</span>下还是需要特殊的处理：</span><br><span class="line">```<span class="selector-tag">css</span></span><br><span class="line">		<span class="selector-id">#footer</span> &#123;</span><br><span class="line">			<span class="attribute">position</span>:fixed;</span><br><span class="line">			<span class="attribute">left</span>:<span class="number">0px</span>;</span><br><span class="line">			<span class="attribute">bottom</span>:<span class="number">0px</span>;</span><br><span class="line">			<span class="attribute">height</span>:<span class="number">30px</span>;</span><br><span class="line">			<span class="attribute">width</span>:<span class="number">100%</span>;</span><br><span class="line">			<span class="attribute">background</span>:<span class="number">#999</span>;</span><br><span class="line">		&#125;</span><br><span class="line"></span><br><span class="line">		<span class="comment">/* IE 6 */</span></span><br><span class="line">		* <span class="selector-tag">html</span> <span class="selector-id">#footer</span> &#123;</span><br><span class="line">			<span class="attribute">position</span>:absolute;</span><br><span class="line">			<span class="attribute">top</span>:<span class="built_in">expression</span>((<span class="number">0</span>-(footer.offsetHeight)+(document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)+(ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop))+<span class="string">'px'</span>);</span><br><span class="line">		&#125;</span><br><span class="line">```	</span><br><span class="line"></span><br><span class="line">## 翻转图片</span><br><span class="line">翻转图像随着<span class="selector-tag">CSS3</span>的<span class="selector-tag">transform</span>越来越实用，不需要重新加载图片，就可以实现一个图片的旋转。常见的是一个三角型效果，我们想让他在不同状态展示不同的风格：</span><br><span class="line">```<span class="selector-tag">css</span></span><br><span class="line">    <span class="selector-tag">img</span><span class="selector-class">.flip</span> &#123;</span><br><span class="line">        <span class="attribute">-moz-transform</span>: <span class="built_in">scaleX</span>(-<span class="number">1</span>);</span><br><span class="line">        <span class="attribute">-o-transform</span>: <span class="built_in">scaleX</span>(-<span class="number">1</span>);</span><br><span class="line">        <span class="attribute">-webkit-transform</span>: <span class="built_in">scaleX</span>(-<span class="number">1</span>);</span><br><span class="line">        <span class="attribute">transform</span>: <span class="built_in">scaleX</span>(-<span class="number">1</span>);</span><br><span class="line">        <span class="attribute">filter</span>: FlipH;</span><br><span class="line">        <span class="attribute">-ms-filter</span>: <span class="string">"FlipH"</span>;</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure></p>
<h2 id="clearfix"><a href="#clearfix" class="headerlink" title="clearfix"></a>clearfix</h2><p>clearfix主要是使用他来清除浮动，只需要添加这个类名无需加上任何HTML标记，就可以达到清除浮动的效果：<br><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-class">.clearfix</span><span class="selector-pseudo">:before</span>,</span><br><span class="line"><span class="selector-class">.clearfix</span><span class="selector-pseudo">:after</span> &#123;</span><br><span class="line">	<span class="attribute">content</span>: <span class="string">" "</span>;</span><br><span class="line">	<span class="attribute">display</span>:table;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.clearfix</span><span class="selector-pseudo">:after</span> &#123;</span><br><span class="line">	<span class="attribute">clear</span>:both;</span><br><span class="line">	<span class="attribute">overflow</span>:hidden;</span><br><span class="line">&#125;</span><br><span class="line"><span class="selector-class">.clearfix</span> &#123; </span><br><span class="line">	<span class="attribute">zoom</span>: <span class="number">1</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<h2 id="圆角"><a href="#圆角" class="headerlink" title="圆角"></a>圆角</h2><p>随着CSS3的属性的出现，我们制作圆角效果就不需要在像以前那样的辛苦了，可以使用CSS3的border-radius来实现，只是在IE-6-8下无法实现，我们来看现代浏览器下如何制作圆角：<br><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-class">.round</span>&#123;</span><br><span class="line">	<span class="attribute">-moz-border-radius</span>: <span class="number">10px</span>;</span><br><span class="line">	<span class="attribute">-webkit-border-radius</span>: <span class="number">10px</span>;</span><br><span class="line">	<span class="attribute">-khtml-border-radius</span>: <span class="number">10px</span>; <span class="comment">/* for old Konqueror browsers */</span></span><br><span class="line">	<span class="attribute">border-radius</span>: <span class="number">10px</span>; <span class="comment">/* future proofing */</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<h2 id="important"><a href="#important" class="headerlink" title="!important"></a>!important</h2><p>!important有时可以帮我们做很多事，他可以覆盖任何相同的样式，换句话说他可以改为样式的权重：<br><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-tag">p</span>&#123;</span><br><span class="line">	<span class="attribute">font-size</span>:<span class="number">20px</span> <span class="meta">!important</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<h2 id="font-face"><a href="#font-face" class="headerlink" title="@font-face"></a>@font-face</h2><p>@font-face也是CSS3的属性之一，他能在所有浏览器下运行。最大的作用就是让用户没有字体的浏览下也能支持网页字体，具体使用：<br><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">		<span class="keyword">@font-face</span> &#123;</span><br><span class="line">			<span class="attribute">font-family</span>: <span class="string">'Graublau Web'</span>;</span><br><span class="line">			<span class="attribute">src</span>: <span class="built_in">url</span>(<span class="string">'GraublauWeb.eot'</span>);</span><br><span class="line">			<span class="attribute">src</span>: <span class="built_in">local</span>(<span class="string">'☺'</span>),</span><br><span class="line">				<span class="built_in">url</span>(<span class="string">'GraublauWeb.woff'</span>) <span class="built_in">format</span>(<span class="string">'woff'</span>), <span class="built_in">url</span>(<span class="string">'GraublauWeb.ttf'</span>) <span class="built_in">format</span>(<span class="string">'truetype'</span>);</span><br><span class="line">		&#125;</span><br><span class="line">		<span class="selector-tag">h2</span> &#123;</span><br><span class="line">			<span class="attribute">font-family</span>:<span class="string">'Graublau Web'</span>;</span><br><span class="line">		&#125;</span><br><span class="line">```	</span><br><span class="line"></span><br><span class="line">## 页面水平居中</span><br><span class="line">如何使一个网站的页面水平居中显示，我想这个不用我说大家也知道，因为大家肯定使用过多次了。</span><br><span class="line">```<span class="selector-tag">css</span></span><br><span class="line">		<span class="selector-class">.wrapper</span> &#123;</span><br><span class="line">			<span class="attribute">width</span>:<span class="number">960px</span>;</span><br><span class="line">			<span class="attribute">margin</span>:<span class="number">0</span> auto;</span><br><span class="line">		&#125;</span><br></pre></td></tr></table></figure></p>
<h2 id="最小高度min-height"><a href="#最小高度min-height" class="headerlink" title="最小高度min-height"></a>最小高度min-height</h2><p>在IE6浏览器下是不支持最小高度这个属性的，为了解决这个问题，我们可以使用下面这样的代码来处理：<br><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">		<span class="selector-class">.box</span> &#123;</span><br><span class="line">			<span class="attribute">min-height</span>:<span class="number">500px</span>;</span><br><span class="line">			<span class="attribute">height</span>:auto <span class="meta">!important</span>;</span><br><span class="line">			<span class="attribute">height</span>:<span class="number">500px</span>;</span><br><span class="line">		&#125;</span><br><span class="line">```	</span><br><span class="line"></span><br><span class="line">## 垂直居中</span><br><span class="line">水平居中处理起来相当的简单的，但是垂直居中处理起来还是相当的烦，特别是要兼容<span class="selector-tag">IE</span>的浏览器情况下：</span><br><span class="line">```<span class="selector-tag">css</span></span><br><span class="line">		<span class="selector-tag">div</span> &#123;</span><br><span class="line">			<span class="attribute">height</span>: <span class="number">100px</span>;</span><br><span class="line">			<span class="attribute">line-height</span>: <span class="number">100px</span>;</span><br><span class="line">			<span class="attribute">white-space</span>: nowrap;</span><br><span class="line">		&#125;</span><br><span class="line"></span><br><span class="line">		<span class="selector-tag">img</span> &#123; <span class="attribute">vertical-align</span>: middle; &#125;</span><br><span class="line"></span><br><span class="line">		<span class="selector-class">.for_ie6</span> &#123; <span class="attribute">display</span>: inline-block; &#125;</span><br><span class="line">		<span class="selector-class">.for_ie6</span> &#123; <span class="attribute">display</span>: inline; &#125;</span><br></pre></td></tr></table></figure></p>
<h2 id="selection"><a href="#selection" class="headerlink" title="::selection"></a>::selection</h2><p>有很多朋友肯定不知道这个属性的作用。它可以改变选择的文本的背景色和前景色，突出你的浏览器中的选择文本效果：</p>
<pre><code class="css"><span class="selector-pseudo">::selection</span> {
    <span class="attribute">color</span>: <span class="number">#000000</span>;
    <span class="attribute">background-color</span>: <span class="number">#FF0000</span>;
}
<span class="selector-pseudo">::-moz-selection</span> {
    <span class="attribute">color</span>: <span class="number">#000000</span>;
    <span class="attribute">background</span>: <span class="number">#FF0000</span>;
}
</code></pre>

            <!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->
            <audio id="audio" loop="1" preload="auto" controls="controls"
                data-autoplay="false">
                <source type="audio/mpeg" src="">
            </audio>
            
            <ul id="audio-list" style="display:none">
                
                
                <li title='0' data-url='/statics/chengdu.mp3'></li>
                
                    
            </ul>
            
            
            
    <div id='gitalk-container' class="comment link"
        data-ae='true'
        data-ci='ec894e2b66f752e8b7fb'
        data-cs='3ccc2e92bb350688fe2c2dc2930189b62622bfb1'
        data-r='blog-comments'
        data-o='TriDiamond'
        data-a='TriDiamond'
        data-d='undefined'
    >Comments</div>


            
            
        </div>
        <div class="sidebar">
            <div class="box animated fadeInRight">
                <div class="subbox">
                    <img src="https://res.cloudinary.com/tridiamond/image/upload/v1573019751/TriDiamond_logo_ui_xeublz.jpg" height=300 width=300></img>
                    <p>张白告丶</p>
                    <span>Think like an artist, develop like an artisan</span>
                    <dl>
                        <dd><a href="https://github.com/zhanghao-web" target="_blank"><span
                                    class=" iconfont icon-github"></span></a></dd>
                        <dd><a href="" target="_blank"><span
                                    class=" iconfont icon-twitter"></span></a></dd>
                        <dd><a href="" target="_blank"><span
                                    class=" iconfont icon-stack-overflow"></span></a></dd>
                    </dl>
                </div>
                <ul>
                    <li><a href="/">149 <p>Articles</p></a></li>
                    <li><a href="/categories">23 <p>Categories</p></a></li>
                    <li><a href="/tags">47 <p>Tags</p></a></li>
                </ul>
            </div>
            
            
            
            <div class="box sticky animated fadeInRight faster">
                <div id="toc" class="subbox">
                    <h4>Contents</h4>
                    <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#使用text-indent来隐藏文本"><span class="toc-number">1.</span> <span class="toc-text">使用text-indent来隐藏文本</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#在IE浏览器中删除textarea的滚动条"><span class="toc-number">2.</span> <span class="toc-text">在IE浏览器中删除textarea的滚动条</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#段落首字下沉"><span class="toc-number">3.</span> <span class="toc-text">段落首字下沉</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#所有浏览器下的CSS透明度"><span class="toc-number">4.</span> <span class="toc-text">所有浏览器下的CSS透明度</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#图片预加载"><span class="toc-number">5.</span> <span class="toc-text">图片预加载</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#基本的CSS-Sprite按钮"><span class="toc-number">6.</span> <span class="toc-text">基本的CSS Sprite按钮</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Google-Font-API"><span class="toc-number">7.</span> <span class="toc-text">Google Font API</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#浏览器的专用hack"><span class="toc-number">8.</span> <span class="toc-text">浏览器的专用hack</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#clearfix"><span class="toc-number">9.</span> <span class="toc-text">clearfix</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#圆角"><span class="toc-number">10.</span> <span class="toc-text">圆角</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#important"><span class="toc-number">11.</span> <span class="toc-text">!important</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#font-face"><span class="toc-number">12.</span> <span class="toc-text">@font-face</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#最小高度min-height"><span class="toc-number">13.</span> <span class="toc-text">最小高度min-height</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#selection"><span class="toc-number">14.</span> <span class="toc-text">::selection</span></a></li></ol>
                </div>
            </div>
            
            
        </div>
    </div>
</div>

    </div>
</div>
    <div id="back-to-top" class="animated fadeIn faster">
        <div class="flow"></div>
        <span class="percentage animated fadeIn faster">0%</span>
        <span class="iconfont icon-top02 animated fadeIn faster"></span>
    </div>
</body>
<footer>
    <p class="copyright" id="copyright">
        &copy; 2020
        <span class="gradient-text">
            张白告丶
        </span>.
        Powered by <a href="http://hexo.io/" title="Hexo" target="_blank" rel="noopener">Hexo</a>
        Theme
        <span class="gradient-text">
            <a href="https://github.com/TriDiamond/hexo-theme-obsidian" title="Obsidian" target="_blank" rel="noopener">Obsidian</a>
        </span>
        <small><a href="https://github.com/TriDiamond/hexo-theme-obsidian/blob/master/CHANGELOG.md" title="v1.4.3" target="_blank" rel="noopener">v1.4.3</a></small>
    </p>
</footer>

<script type="text/javascript" src="https://cdn.bootcss.com/mathjax/2.7.6/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<script>
  MathJax.Hub.Config({
    "HTML-CSS": {
      preferredFont: "TeX",
      availableFonts: ["STIX", "TeX"],
      linebreaks: {
        automatic: true
      },
      EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50)
    },
    tex2jax: {
      inlineMath: [
        ["$", "$"],
        ["\\(", "\\)"]
      ],
      processEscapes: true,
      ignoreClass: "tex2jax_ignore|dno",
      skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    },
    TeX: {
      noUndefined: {
        attributes: {
          mathcolor: "red",
          mathbackground: "#FFEEEE",
          mathsize: "90%"
        }
      },
      Macros: {
        href: "{}"
      }
    },
    messageStyle: "none"
  });
</script>
<script>
  function initialMathJax() {
    MathJax.Hub.Queue(function () {
      var all = MathJax.Hub.getAllJax(),
        i;
      // console.log(all);
      for (i = 0; i < all.length; i += 1) {
        console.log(all[i].SourceElement().parentNode)
        all[i].SourceElement().parentNode.className += ' has-jax';
      }
    });
  }

  function reprocessMathJax() {
    if (typeof MathJax !== 'undefined') {
      MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
    }
  }
</script>



    
<link rel="stylesheet" href="//cdn.bootcss.com/gitalk/1.5.0/gitalk.min.css">

    
<script src="//cdn.bootcss.com/gitalk/1.5.0/gitalk.min.js"></script>



<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="/js/plugin.js"></script>
<script src="/js/obsidian.js"></script>
<script src="/js/jquery.truncate.js"></script>
<script src="/js/search.js"></script>


<script src="//cdn.bootcss.com/typed.js/2.0.10/typed.min.js"></script>


<script src="//cdn.bootcss.com/blueimp-md5/2.12.0/js/md5.min.js"></script>


<script src="//cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/js/social-share.min.js"></script>


<script src="https://cdn.bootcss.com/codemirror/5.48.4/codemirror.min.js"></script>

    
<script src="//cdn.bootcss.com/codemirror/5.48.4/mode/javascript/javascript.min.js"></script>


    
<script src="//cdn.bootcss.com/codemirror/5.48.4/mode/css/css.min.js"></script>


    
<script src="//cdn.bootcss.com/codemirror/5.48.4/mode/xml/xml.min.js"></script>


    
<script src="//cdn.bootcss.com/codemirror/5.48.4/mode/htmlmixed/htmlmixed.min.js"></script>


    
<script src="//cdn.bootcss.com/codemirror/5.48.4/mode/clike/clike.min.js"></script>


    
<script src="//cdn.bootcss.com/codemirror/5.48.4/mode/php/php.min.js"></script>


    
<script src="//cdn.bootcss.com/codemirror/5.48.4/mode/shell/shell.min.js"></script>


    
<script src="//cdn.bootcss.com/codemirror/5.48.4/mode/python/python.min.js"></script>




    
<script src="/js/busuanzi.min.js"></script>

    <script>
        $(document).ready(function () {
            if ($('span[id^="busuanzi_"]').length) {
                initialBusuanzi();
            }
        });
    </script>



<link rel="stylesheet" href="//cdn.bootcss.com/photoswipe/4.1.3/photoswipe.min.css">
<link rel="stylesheet" href="//cdn.bootcss.com/photoswipe/4.1.3/default-skin/default-skin.min.css">


<script src="//cdn.bootcss.com/photoswipe/4.1.3/photoswipe.min.js"></script>
<script src="//cdn.bootcss.com/photoswipe/4.1.3/photoswipe-ui-default.min.js"></script>


<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>
    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">
        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>
        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">
            <div class="pswp__top-bar">
                <!--  Controls are self-explanatory. Order can be changed. -->
                <div class="pswp__counter"></div>
                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
                <button class="pswp__button pswp__button--share" title="Share"></button>
                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                      <div class="pswp__preloader__cut">
                        <div class="pswp__preloader__donut"></div>
                      </div>
                    </div>
                </div>
            </div>
            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div> 
            </div>
            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>
            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>
            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>
        </div>
    </div>
</div>



    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="//www.googletagmanager.com/gtag/js?id=UA-149874671-1"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());

        gtag('config', 'UA-149874671-1');
    </script>





<script>
    function initialTyped () {
        var typedTextEl = $('.typed-text');
        if (typedTextEl && typedTextEl.length > 0) {
            var typed = new Typed('.typed-text', {
                strings: ["Think like an artist, develop like an artisan", "艺术家思维去思考问题，工匠创造精神去开发"],
                typeSpeed: 90,
                loop: true,
                loopCount: Infinity,
                backSpeed: 20,
            });
        }
    }

    if ($('.article-header') && $('.article-header').length) {
        $(document).ready(function () {
            initialTyped();
        });
    }
</script>




</html>
